import { createRouter, createWebHistory } from 'vue-router'
import User from '../views/User.vue'
import Layout from "@/layout/Layout";
import Login from "@/views/Login"
import Data from "@/views/Data";
import Service from "@/views/Service";

const routes = [
  {
    path: '/',
    name: 'layout',
    component: Layout,
    redirect: '/user',
    children: [
      {
        path: '/user',
        name: 'user',
        component: User,
      },
      {
        path: '/data',
        name: 'data',
        component: Data,
      },
      {
        path: '/serviceData',
        name: 'service',
        component: Service,
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
